﻿using System;
using Mbs.ComponentModel.Container.Metadata;

namespace Mbs.ComponentModel.Container.Listner
{
    [Serializable]
    public class InitializationListner:KernelListnerAdapter
    {
        private InitializationListner() : base(LifestyleStage.Created) { }

        public static readonly IKernelListner Instance = new InitializationListner();

        public override void OnCreated(IComponentInfo info, object instance)
        {
            var startable = instance as IInitializable;
            if (startable != null)
                startable.Init();
        }
    }
}
